package org.goldfish.demo011;

import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "gf-servlet",value = "/gf-servlet")
public class GoldfishServlet extends HttpServlet {
    String message;

    public void init() {
        message = "Hello from Goldfish Servlet";
    }

    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setContentType("text/html");
        HTMLGenerator generator=new HTMLGenerator("Site1");
        generator.addLink("bing","cn.bing.com");
        generator.addOrderedList(new String[]{"1","2","3"});
        generator.addOrderedList(new String[]{"4","5","6"});
        response.getWriter().println(generator.get());
    }
    public void destroy() {

    }
}
